import { defHttp } from '/@/utils/http/axios';
import { ApiCommon } from '../common';

const { CUSTOMER_ADMIN_API, BILLING_ADMIN_API } = ApiCommon;

enum Api {
  TAG_INFO = '/integrated-business/tag/info', // 综合业务办理-标签栏信息
  USER_LIST = '/integrated-business/user/info/', // 综合业务办理查询账户列表
  ADVANCED_QUERY_CONDITION = '/integrated-business/user/advancedQueryCondition', // 综合业务办理查询账户列表
  INVOICE_LIST = '/invoice/list', // 综合业务办理查询账户列表
  AWAIT_LIST = '/invoice/invoice-print/page/await', // 综合业务办理-待开票
  FINISH_LIST = '/invoice/invoice-print/page/finish', // 综合业务办理-已开票开票
  RUSH_RED_End_LIST = '/invoice/invoice-print/page/rushred', // 综合业务办理-已冲红
  RUSHRED = '/invoice/rushRed', // 综合业务办理-已开票冲红
  REINVOICE = '/invoice/reInvoice', // 综合业务办理-已开票重开
  INVOICE = '/invoice/invoice', // 综合业务办理-去开票
  LIST_BY_DETAIL_IDS = '/invoice-detail/listByDetailIds', // 综合业务办理-开票列表
  SENDINVOICE = '/invoice-record/sendInvoice', // 综合业务办理-推送
  MERGEPDF = '/invoice-record/invoice-merge', //综合业务办理-批量打印
  GET_CUSTOMER_USER_RECORD = '/user/getCustomerUserRecord', // 获取该账户的所有业务记录数量
  ADVANCED_QUERY_SELECT = '/integrated-business/user/advancedQuerySelect', // 搜索条件数据
}
/**
 * @description: 请求的API地址
 */
export const getUserListApi = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.ADVANCED_QUERY_CONDITION, data }); // 综合业务办理查询账户列表
// export const getUserListApi = (data: object) =>
//   defHttp.post({ url: CUSTOMER_ADMIN_API + Api.USER_LIST, data }); // 综合业务办理查询账户列表
export const getTagInfoApi = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.TAG_INFO, params }); // 综合业务办理查标签栏信息
export const getInvoiceListApi = () => defHttp.get({ url: BILLING_ADMIN_API + Api.INVOICE_LIST }); // 综合业务办理发票打印下拉
export const getAwaitListApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.AWAIT_LIST, data }); // 综合业务办理-待开票
export const getFinishListApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.FINISH_LIST, data }); // 综合业务办理-已开票开票
export const getRushredEndListApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.RUSH_RED_End_LIST, data }); // 综合业务办理-已冲红
export const rushredApi = (data: string[]) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.RUSHRED, data }); // 综合业务办理-已开票冲红
export const reInvoiceApi = (data: string[]) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.REINVOICE, data }); // 综合业务办理-已开票重开
export const invoiceApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.INVOICE, data }); // 综合业务办理-去开票
export const listByDetailApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.LIST_BY_DETAIL_IDS, data }); // 综合业务办理-开票列表
export const listSendInvoiceApi = (data: object) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.SENDINVOICE, data }); // 综合业务办理-推送
export const mergeInvoiceApi = (data: any) =>
  defHttp.post({ url: BILLING_ADMIN_API + Api.MERGEPDF, data }); // 综合业务办理-批量打印
export const getUsersInfo = (data: any) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.GET_CUSTOMER_USER_RECORD, data }); // 综合业务办理-获取该账户的所有业务记录数量
export const getLabelSelectApi = (data: any) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.ADVANCED_QUERY_SELECT, data }); // 综合业务办理-获取该账户的所有业务记录数量
